package com.im.webws;

import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.socket.server.standard.ServerEndpointExporter;


/**
 * Created by 岸芷汀翎 on 2017/1/27.
 * Description:
 */
@Configuration
public class WebSocketConfig implements ApplicationContextAware{
	public static ApplicationContext appContext;

    @Bean
    public ServerEndpointExporter serverEndpointExporter() {
        return new ServerEndpointExporter();
    }

    // 目前通过此种方式获取注入的spring bean
	@Override 
	public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
		// TODO Auto-generated method stub
		appContext = applicationContext;
	}

}
